import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../widget/my_image.dart';
class FastProduct extends StatefulWidget {
  final List<dynamic> fastProduct;
  FastProduct({this.fastProduct});
  @override
  _FastProductState createState() => _FastProductState();
}

class _FastProductState extends State<FastProduct> {
  @override
  Widget build(BuildContext context) {
      return Container(
        height: 280.h,
        color: Colors.white,
        padding: EdgeInsets.all(20.w),
        child: ListView.builder(
          physics: BouncingScrollPhysics(),
          scrollDirection: Axis.horizontal,
          itemBuilder: (context, index) {
            return Row(
              children: [
                InkWell(
                  onTap: (){
//                    Navigator.of(context).pushNamed('/productContent',arguments: {'productId':widget.fast_product[index]['productId']});
                  },
                  child:Container(
                    decoration: BoxDecoration(
                        borderRadius:BorderRadius.circular(10),
                        border: Border.all(color:Color.fromRGBO(244, 244, 244, 1.0))
                    ),
                    child: Column(
                      children: <Widget>[
                        Container(
                          height: 180.w,
                          width: 180.w,
                          alignment: Alignment.center,
//                  color:Colors.red,
                          decoration: BoxDecoration(
                              borderRadius:BorderRadius.circular(10),
                          ),
                          child: MyImage(
                            imgSrc: widget.fastProduct[index]['pic'],
                          ),
                        ),
                        Container(
                          padding: EdgeInsets.only(top: 10.h),
                          height: 44.h,
                          child: Text(
                            "${widget.fastProduct[index]['cateName']}",
                            textAlign: TextAlign.center,
                            style: TextStyle(color: Colors.black54),
                          ),
                        )
                      ],
                    ),
                  ),
                ),
                SizedBox(
                  width:20
                )
              ],
            );
          },
          itemCount: widget.fastProduct.length,
        ),
      );
  }
}
